Skip to main content
Glama
Southclaws

Storyden

by Southclaws
page.tsx1.44 kB
import { z } from "zod"; import { threadGet } from "@/api/openapi-server/threads"; import { getServerSession } from "@/auth/server-session"; import { getSettings } from "@/lib/settings/settings-server"; import { ThreadScreen } from "@/screens/thread/ThreadScreen/ThreadScreen"; export type Props = { params: Promise<{ slug: string; }>; searchParams: Promise<Query>; }; const QuerySchema = z.object({ page: z .string() .transform((v) => parseInt(v, 10)) .optional(), }); type Query = z.infer<typeof QuerySchema>; export default async function Page(props: Props) { const { slug } = await props.params; const searchParams = await props.searchParams; const { page } = QuerySchema.parse(searchParams); const { data } = await threadGet(slug, { page: page?.toString(), }); const session = await getServerSession(); return ( <ThreadScreen initialSession={session} initialPage={page} slug={slug} thread={data} /> ); } export async function generateMetadata(props: Props) { const params = await props.params; try { const settings = await getSettings(); const { data } = await threadGet(params.slug); return { title: `${data.title} | ${settings.title}`, description: data.description, }; } catch (e) { return { title: "Thread Not Found", description: "The thread you are looking for does not exist.", }; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server